Loading the data

Before we can analyze anything, we must load our data. Since we do not have a CSV, we can use the read.table() function to ensure accurate importing.

ClimateData <- read.table("clim.txt", header = T)
# load climate dataset with a header

Once our data is loaded, we see that this dataset gives us:

for every day of the year since 1942.

Winter Precipitation and Summer Temperatures

Now that we have datasets containing average seasonal precipitation and temperatures, we can use them to explore additional seasonal trends. Two seasonal variables of particular interest are winter precipitation and summer temperatures. These variables in particular are the limiting factors for many varieties of plant species.

To pick out only the winter precipitation and summer temperature data from our full datasets, we can use the subset() function.

winter_precip <- subset(seasonal_precip, Season == 4)  
# create a new dataset with only winter precipitation data for each year

winter_precip <- winter_precip[,-1]  
# remove the "season" column since we no longer need it 

summer_temp <- subset(seasonal_temp, Season == 2)  
# create a new dataset with only summer temperature data for each year 

summer_temp <- summer_temp[,-1]  
# remove the "season" column since we no longer need it 

Once we have subsetted our data so that only our variables of interest remain, we can plot them on the same graph to compare trends.

plot(x = winter_precip$Year, y = winter_precip$Precip, type = "l", col = "cyan", xlab = "Year", ylab = "Value", main = "Winter Precipitation and Summer Temperature")
lines(x = summer_temp$Year, y = summer_temp$Temp, col = "purple")

As this graph illustrates, both winter precipitation (shown here in blue) and summer temperatures (shown here in purple) can vary greatly over the years. However, it appears that drier winters are often associated with hotter summers, creating a double-whammy for sensitive vegetation. Keeping track of these trends can help us to remain aware of when ecosystems are particularly vulnerable due to climatic variations. new change2

P.S. Here is a change to be committed.